DM-49378: Trim totalBox to destination warped bbox in getTemplate#388
DM-49378: Trim totalBox to destination warped bbox in getTemplate#388
Conversation
This should significantly cut memory usage, as it will only make unwarped exposures as large as necessary, not multiple patches in size.
This is necessary to use the dataId as a dict key.
f9abf59 to
5a96106
Compare
isullivan
left a comment
There was a problem hiding this comment.
The code looks good. I don't have any requested changes.
|
|
||
| catalogs.append(catalog) | ||
| warped[tract] = potentialInput | ||
| warped[tract].setWcs(wcs) |
There was a problem hiding this comment.
Was this line unnecessary, because it's set in _merge?
There was a problem hiding this comment.
Yes, the merged result has the wcs when it is created.
| maskedImages, catalog, totalBox = self._makeExposureCatalog(coaddExposureHandles[tract], | ||
| dataIds[tract]) | ||
| warpedBox = computeWarpedBBox(catalog[0].wcs, bbox, wcs) | ||
| warpedBox.grow(5) # to ensure we catch all relevant input pixels |
There was a problem hiding this comment.
My understanding of computeWarpedBBox is that that already errs on the side of a larger box, so growing it here is probably unnecessary. That said, an extra 5 pixels shouldn't make much of a difference, and it will still be fewer pixels than before.
There was a problem hiding this comment.
I found that without growing the box by a few pixels, the corners in the tests weren't correct, so I decided to be a bit generous here.
python/lsst/ip/diffim/getTemplate.py
Outdated
|
|
||
| catalogs.append(catalog) | ||
| # Trim the exposure catalog to just the patches that were used. | ||
| temp = afwTable.ExposureCatalog(self.schema) |
There was a problem hiding this comment.
Please use something like tempCatalog instead of just temp for the variable name.
We can trim the exposure catalog to only include patches that were used, thus reducing the number of entries in the final CoaddPsf.
ad68e1c to
ff976f6
Compare
No description provided.